package MTT::Schema::Result::Switch;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
use namespace::autoclean;
extends 'DBIx::Class::Core';

__PACKAGE__->load_components("InflateColumn::DateTime", "EncodedColumn");

=head1 NAME

MTT::Schema::Result::Switch

=cut

__PACKAGE__->table("switchs");

=head1 ACCESSORS

=head2 id

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0

=head2 host_code

  data_type: 'varchar'
  is_nullable: 0
  size: 13

=head2 descr

  data_type: 'varchar'
  is_nullable: 1
  size: 42

=head2 id_type

  data_type: 'integer'
  is_foreign_key: 1
  is_nullable: 0

=head2 trunk_in

  data_type: 'varchar'
  default_value: 1
  is_nullable: 0
  size: 100

=head2 trunk_out

  data_type: 'varchar'
  default_value: 1
  is_nullable: 0
  size: 100

=head2 updated

  data_type: 'datetime'
  is_nullable: 1

=head2 created

  data_type: 'datetime'
  is_nullable: 1

=head2 status

  data_type: 'integer'
  default_value: 0
  is_nullable: 1

=head2 table_name

  data_type: 'varchar'
  is_nullable: 1
  size: 13

=cut

__PACKAGE__->add_columns(
  "id",
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
  "host_code",
  { data_type => "varchar", is_nullable => 0, size => 13 },
  "descr",
  { data_type => "varchar", is_nullable => 1, size => 42 },
  "id_type",
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
  "trunk_in",
  { data_type => "varchar", default_value => 1, is_nullable => 0, size => 100 },
  "trunk_out",
  { data_type => "varchar", default_value => 1, is_nullable => 0, size => 100 },
  "updated",
  { data_type => "datetime", is_nullable => 1 },
  "created",
  { data_type => "datetime", is_nullable => 1 },
  "status",
  { data_type => "integer", default_value => 0, is_nullable => 1 },
  "table_name",
  { data_type => "varchar", is_nullable => 1, size => 13 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("host_code", ["host_code"]);

=head1 RELATIONS

=head2 alarm_switches

Type: has_many

Related object: L<MTT::Schema::Result::AlarmSwitch>

=cut

__PACKAGE__->has_many(
  "alarm_switches",
  "MTT::Schema::Result::AlarmSwitch",
  { "foreign.id_switch" => "self.id" },
  { cascade_copy => 0, cascade_delete => 0 },
);

=head2 id_type

Type: belongs_to

Related object: L<MTT::Schema::Result::SwitchType>

=cut

__PACKAGE__->belongs_to(
  "id_type",
  "MTT::Schema::Result::SwitchType",
  { id => "id_type" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);


# Created by DBIx::Class::Schema::Loader v0.07002 @ 2011-01-23 22:33:09
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ipp4Y9e1vLOUUow99cNeiw


# You can replace this text with custom content, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1;
